<?php
/**
 * +------------------------------
 * Created by PhpStorm.
 * +------------------------------
 * User: xxx
 * +------------------------------
 * DateTime: 2020/3/4 11:57
 * +------------------------------
 */

/**
 * 全局基类
 * Class BaseController
 */
class BaseController extends Controller
{

    public function init()
    {
        header("Content-type: text/html; charset=utf-8");
        $this->_auto_display = false;
    }

    public static function err404($__module, $__controller, $__action, $msg)
    {
        exit($msg);
    }

    public function tips($msg, $url)
    {
        $url = "location.href=\"{$url}\";";
        echo "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><script>function sptips(){alert(\"{$msg}\");{$url}}</script></head><body onload=\"sptips()\"></body></html>";
        exit;
    }

    public function jump($url, $delay = 0)
    {
        echo "<html><head><meta http-equiv='refresh' content='{$delay};url={$url}'></head><body></body></html>";
        exit;
    }

}